package com.atjava.nebula.web.jta;

import org.hibernate.cfg.ImprovedNamingStrategy;
import org.hibernate.internal.util.StringHelper;

public class NebulaJbpmNamingStrategy extends ImprovedNamingStrategy {

	private static final long serialVersionUID = 7091477045079679551L;

	public String classToTableName(String className) {
		return StringHelper.unqualify(className);
	}

	public String propertyToColumnName(String propertyName) {
		return propertyName;
	}

	public String tableName(String tableName) {
		return "JBPM_" + tableName;
	}

	public String columnName(String columnName) {
		return columnName;
	}

	public String propertyToTableName(String className, String propertyName) {
		return "JBPM_" + classToTableName(className) + '_'
				+ propertyToColumnName(propertyName);
	}

}
